package com.xiao.wiki.config;


import com.xiao.wiki.interceptor.LogInterceptor;
import org.springframework.context.annotation.Configuration;

import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author ：降蓝
 * @description：TODO
 * @date ：2022/7/3 17:04
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {
    @Resource
    LogInterceptor logInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logInterceptor)
                .addPathPatterns("/**").
                excludePathPatterns(
                        "/login",
                        "/ebookSnapshot/**"
                );
    }
}
